home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mikecom / rxcnt.asm < prev    next >
Assembly Source File  |  1987-05-15  |  958b  |  28 lines

  1.  
  2. title GET BYTES IN RX BUFFER
  3. include subfx.h
  4.  
  5. ;  Mike Dumdei,  6 Holly Lane,  Texarkana TX  75503
  6.  
  7. ;****************************************************************************
  8. ; ASYNC_RXCNT -- Returns number of characters in the receive buffer that have
  9. ;  not been read out.  Returns R_RXERR if invalid port.
  10. ;****************************************************************************
  11. begseg          COMM_TEXT
  12. publicproc      _async_rxcnt
  13.         push    bp
  14.         mov     bp,sp
  15.         push    si              ;C stck frame, save regs
  16.         call    __ck_port_arg   ;ck for valid arg and load pointers
  17.         jz      cnt_exit        ;arg was bad if ZR set on rtrn
  18.         mov     ax,RX_SIZE
  19.         sub     ax,RX_FREE      ;calc # bytes of unread bufr data
  20. cnt_exit:
  21.         pop     si
  22.         pop     bp
  23.         ret                     ;restore regs and exit
  24. _async_rxcnt    endp
  25. endseg          COMM_TEXT
  26.         end
  27.  
  28.